#!/usr/bin/env ruby
#coding:utf-8
$KCODE='u' if RUBY_VERSION<'1.9'

Picrawler_gateway_path="Picrawler.rb" ###

###main
require "fileutils"
STDOUT.sync = true

if __FILE__==$0
	Dir.chdir(File.dirname(__FILE__))

	require File.expand_path(Picrawler_gateway_path) ### Picrawler module path ###
	pic=Picrawler.new(File.expand_path("Picrawler.ini"),lambda{|mes|print mes.encode(@encoding,"UTF-8")});@encoding=pic.encoding

	#write crawler below
	#dir must be .encode(@encoding,"UTF-8")
	pic.pcrawl 'Pixiv','member',:arg=>'number',:fast=>true
end
